package com.deke.teacher.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.deke.teacher.service.CheckTeacherService;
import com.deke.entity.CheckTeacherVo;
import com.deke.teacher.vo.EduCheckVo;
import com.deke.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ：张恒（1371745897@qq.com）
 * @date ：Created in 2022/12/10 0:28
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/cores/checkTeacher")
@Api(tags = "讲师分类")
public class CheckTeacherController {
    @Resource
    private CheckTeacherService checkTeacherService;

    @PostMapping("/findTeacherCheck/{current}/{pageSize}")
    @ApiOperation(value = "讲师审核分类分页列表接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "eduCheckVo", value = "实体类"),
            @ApiImplicitParam(name = "current", value = "每页几条数据"),
            @ApiImplicitParam(name = "pageSize", value = "第几页")
    })
    public Result<IPage<EduCheckVo>> findTeacherCheck(@RequestBody EduCheckVo eduCheckVo,
                                                      @PathVariable Integer current,
                                                      @PathVariable Integer pageSize) {
        /**
         * @create by: 张恒
         * @description: 讲师审核列表的分页
         * @create time: 2023/1/30 14:15
         * @param eduCheckVo 讲师审核信息实体类
		 * @param current 每页多少条
		 * @param pageSize 几页
         * @return com.deke.vo.Result<com.baomidou.mybatisplus.core.metadata.IPage<com.deke.teacher.vo.EduCheckVo>>
         */
        return checkTeacherService.queryByConditionPage(eduCheckVo, current, pageSize);
    }



    /**
     * @create by: 张恒
     * @description: 审核状态的修改
     * @create time: 2023/1/30 14:14
     * @param checkTeacherVo 讲师审核的实体类
     * @return com.deke.vo.Result
     */
    @PostMapping("/changeTeacherCheck")
    @ApiOperation(value = "审核状态的修改")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "checkTeacherVo", value = "实体类")
    })
    public Result changeTeacherCheck(@RequestBody CheckTeacherVo checkTeacherVo) {
        return checkTeacherService.updateCheckStatusById(checkTeacherVo);
    }

}